package com.example.homelicaisystem.services.impl;

import com.example.homelicaisystem.dao.FamilyMapper;
import com.example.homelicaisystem.entity.User;
import com.example.homelicaisystem.services.FamilyService;
import com.example.homelicaisystem.services.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FamilyImpl implements FamilyService {
    private final FamilyMapper familyMapper;
    private final UserService userService;

    public FamilyImpl(FamilyMapper familyMapper, UserService userService) {
        this.familyMapper = familyMapper;
        this.userService = userService;
    }

    @Override
    public Integer getFamilyIdByUserId(Integer userId) {

        return familyMapper.getFamilyIdByUserId(userId);

    }

    @Override
    public List<User> getList(int familyId) {
        return familyMapper.getList(familyId);
    }

    @Override
    public void createFamily(User data) {
        familyMapper.createFamily(data);
    }

}
